import {Context} from "koa";
import "reflect-metadata"

const { service, database } = require('./config')
const Koa = require('koa')
const genres = require('koa-res')

const app = new Koa()
app.use(genres())
app.use(async (ctx: Context, next: Function) => {
    console.log('ip', ctx.method, ctx.url)
    console.log(database.modelPath)
    await next()
})

app.use(async (ctx: Context, next: Function) => {
    console.log(ctx.url)
    await next()
})

// app.use(srv)

app.listen(service.port, () => {
    console.log(`服务已启用, 端口${service.port}`)
})